<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: study.js</title>
    
    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">
    
    <h1 class="page-title">Source: study.js</h1>
    
    


    
    <section>
        <article>
            <pre class="prettyprint source"><code>/**
 * A collection of common Javascript functions used throughout the RMS for
 * interacting with the user study API.
 *
 * @fileOverview A collection of common Javascript functions used throughout the
 *  RMS for interacting with the user study API.
 * @name RMS Studies
 * @author Russell Toris &lt;rctoris@wpi.edu>
 * @version April, 13 2013
 */

/**
 * Log the given message into the study_logs MySQL table. This function will
 * only work if the _EXPID global variable is defined.
 *
 * @param mesasge
 *            {string} the message to log
 */
function studyLog(message) {
  if (typeof (_EXPID) !== 'undefined') {
    // create an AJAX request
    var data = new FormData();
    data.append('expid', _EXPID);
    data.append('entry', message);
    $.ajax('../../api/user_studies/study_logs/', {
      data : data,
      cache : false,
      contentType : false,
      processData : false,
      type : 'POST',
      beforeSend: function (xhr) {
        // authenticate with the header
        xhr.setRequestHeader('RMS-Use-Session', 'true');
      }
    });
  }
}
</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Index</a></h2><h3>Global</h3><ul><li><a href="global.html#base64Encode">base64Encode</a></li><li><a href="global.html#createErrorDialog">createErrorDialog</a></li><li><a href="global.html#createMenuButtons">createMenuButtons</a></li><li><a href="global.html#createModalPageLoading">createModalPageLoading</a></li><li><a href="global.html#createSlideshow">createSlideshow</a></li><li><a href="global.html#logout">logout</a></li><li><a href="global.html#removeModalPageLoading">removeModalPageLoading</a></li><li><a href="global.html#rosonline">rosonline</a></li><li><a href="global.html#studyLog">studyLog</a></li></ul>
</nav>

<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Tue Apr 16 2013 13:15:03 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
</body>
</html>
